<ui:composition template="/WEB-INF/templates/defaultLayout.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">

	<ui:define name="layoutWest">
		<ui:include src="serviceTypeTreeview.xhtml"/>
	</ui:define>

	<ui:define name="layoutCenter">
		<h:form>
			<p:growl id="growl"/>
			<p:breadCrumb>
				<p:menuitem value="#{lang.getTrans('ui.mobile.common.bread.home')}" url="/home.xhtml"/>
				<p:menuitem value="#{lang.getTrans('ui.mobile.common.bread.service.type')}" url="/crud/serviceType/serviceTypeList.xhtml"/>
				<p:menuitem value="#{lang.getTrans('ui.mobile.common.bread.editar')}" url="/crud/serviceType/serviceTypeForm.xhtml"/>
			</p:breadCrumb>
			<p:panel id="panel" header="#{lang.getTrans('ui.mobile.service.type.cadastre')}">
				<h:panelGrid columns="2">
					<h:outputLabel for="cdServiceType" 
						value="#{lang.getTrans('ui.mobile.service.type.name')}"/>
					<p:inputText id="cdServiceType"
						value="#{serviceTypeBean.serviceType.cdServiceType}"
						required="true"
						requiredMessage="#{lang.getTrans('ui.mobile.service.type.name.obrigatorio')}"
						size="50" maxlength="60" />

					<h:outputLabel for="dsServiceType" 
						value="#{lang.getTrans('ui.mobile.service.type.description')}"/>
					<p:inputTextarea id="dsServiceType" required="true" cols="50" rows="10" 
						value="#{serviceTypeBean.serviceType.dsServiceType}"
						requiredMessage="#{lang.getTrans('ui.mobile.service.type.description.obrigatorio')}" />

					<h:outputLabel for="cdTimeAttendance" 
						value="#{lang.getTrans('ui.mobile.service.type.time.attendance')}"/>
					<p:inputMask id="cdTimeAttendance" value="#{serviceTypeBean.serviceType.cdTimeAttendance}"
						size="20" maxlength="10" mask="99:99:99" title="dias:horas:minutos"/>
					
					<h:outputLabel for="cdTimeSolution" 
						value="#{lang.getTrans('ui.mobile.service.type.time.solution')}"/>
					<p:inputMask id="cdTimeSolution" value="#{serviceTypeBean.serviceType.cdTimeSolution}"
						size="20" maxlength="10" mask="99:99:99" title="dias:horas:minutos" />
	
					
				</h:panelGrid>
			</p:panel>
			<p:blockUI block="panel" trigger="btInsert"/>
			<p:panel style="text-align:center">
				<h:inputHidden id="idServiceType" value="#{serviceTypeBean.serviceType.idServiceType}" />
				<h:inputHidden id="idServiceTypePai" value="#{serviceTypeBean.serviceType.idServiceTypePai}" />
				<h:inputHidden id="nrVersion" value="#{serviceTypeBean.serviceType.nrVersion}" />
				<p:commandButton id="btInsert" value="#{lang.getTrans('ui.mobile.common.save')}"
					type="submit" action="#{serviceTypeBean.adicionar}" update="growl"/>
				<p:button value="#{lang.getTrans('ui.mobile.common.cancel')}" outcome="serviceTypeList" />
			</p:panel>
			
		</h:form>
	</ui:define>
</ui:composition>